{% macro gen_table(specs, current_user, kwargs) %}
    <table id="spec-table"
           class="table table-bordered table-hover table-condensed table-striped">
        <thead>
        <tr>
            <th>序号</th>
            <th>产品类型</th>
            <th>规格名称</th>
            <th>单位</th>
            <th>是否输入类型</th>
            <th>权重</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for spec in specs %}
            <tr>
                <td>{{ loop.index }}</td>
                <td>{{ spec.product_type_name }}</td>
                <td>{{ spec.name }}</td>
                <td>{{ spec.unit_display }}</td>
                <td>{{ spec.input_type_display }}</td>
                <td>{{ spec.weight }}</td>
                <td>
                    <a
                            class="btn btn-xs btn-primary"
                            href="{{ url_for('product_bp.edit_spec', spec_id=spec.id) }}"
                            name="user-info"
                            target="_self"
                    >编辑</a><br>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endmacro %}
